package day22;

import java.util.HashMap;
import java.util.Scanner;

/**
 * @author tongchen
 * @create 2023-03-29 19:38
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextLine()){
            String s=scanner.nextLine();
            char only = findOnly(s);
            if(only=='?'){
                System.out.println(-1);
            }
            else{
                System.out.println(only);
            }
        }

    }
    public static char findOnly(String s){
        //创建map
        HashMap<Character, Integer> map = new HashMap<>();
        //循环加入
        for(int i=0;i<s.length();++i){
            map.put(s.charAt(i), map.getOrDefault(s.charAt(i), 0)+1);
        }
        //第二遍遍历显示结果
        for(int i=0;i<s.length();++i){
            if(map.get(s.charAt(i))==1){
                return s.charAt(i);
            }
        }
        return '?';
    }
}
